﻿using CommunityToolkit.Mvvm.ComponentModel;
using GameView.Comment;
using System.ComponentModel.DataAnnotations;

namespace GameView.Services.Dtos.SysLogDto
{
    public partial class SysLogQueryDto : ObservableValidator
    {
        /// <summary>
        /// 开始时间
        /// </summary>
        public string StartTime => StartTimeDT.ReBuildTIme(StartTime24);

        /// <summary>
        /// 结束时间
        /// </summary>
        public string EndTime => EndTimeDT.ReBuildTIme(EndTime24);

        /// <summary>
        /// 开始时间
        /// </summary>
        [ObservableProperty]
        [Required]
        [NotifyPropertyChangedFor(nameof(StartTime))]
        private string _startTimeDT = DateTime.Now.ToStringFormatShort();

        /// <summary>
        /// 结束时间
        /// </summary>
        [ObservableProperty]
        [Required]
        [NotifyPropertyChangedFor(nameof(EndTime))]
        private string _endTimeDT = DateTime.Now.ToStringFormatShort();

        /// <summary>
        /// 开始时间
        /// </summary>
        [ObservableProperty]
        [Required]
        [NotifyPropertyChangedFor(nameof(StartTime))]
        private string _startTime24 = "00:00";

        /// <summary>
        /// 结束时间
        /// </summary>
        [ObservableProperty]
        [Required]
        [NotifyPropertyChangedFor(nameof(EndTime))]
        private string _endTime24 = "23:59";

        /// <summary>
        /// 当前页
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页行数
        /// </summary>
        public int PageSize { get; set; } = 20;

        /// <summary>
		/// 模块名称
		/// </summary>
		public string ActionName { get; set; }

        /// <summary>
		/// 操作人
		/// </summary>
		public string OperateUser { get; set; }

        /// <summary>
        /// 执行结果: 1正常，2异常
        /// </summary>
        public int? Result { get; set; }

        /// <summary>
        /// 操作类型
        /// </summary>
        public int? OperateType { get; set; }
    }
}